package com.zyd.util;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * 字段映射
 */
public class FieldMapping {

    private Map<String, String> fieldMap = Maps.newHashMap();


    public void addMapping(String origin, String dst) {
        fieldMap.put(dst, origin);
    }


    public String getMapping(String dst) {
        String ret = fieldMap.get(dst);
        if (StringUtils.isBlank(ret)) {
            return dst;
        } else {
            return ret;
        }
    }

}
